<template>
  <div class="container">
    <div style="border-bottom:1px solid #ccc;padding-bottom:50px">
      <div class="card_nd_title">
        <span>饮食得分</span>
        <div class="line" style="width:64px;"></div>
      </div>
      <div class="card_content">
        <p>饮食得分：{{ report.dietScore.toFixed() }}分</p>
        <line-charts
          style="margin-bottom:30px"
          :x-axis-data="charts.axisData"
          :legend="charts.legend"
          :series-data="charts.seriesData"
        ></line-charts>
      </div>
    </div>
  </div>
</template>

<script>
import lineCharts from '../../components/LineChart'
export default {
  name: 'Diet',
  props: ['report'],
  components: { lineCharts },
  data() {
    return {
      charts: {
        axisData: [],
        axisUnit: '',
        seriesData: [],
        legend: []
      }
    }
  },
  created() {
    this.charts.axisData = this.report.dates
    this.charts.legend = ['饮食']
    this.charts.seriesData.push(this.report.values.map(v => v.toFixed()))
  },
  methods: {}
}
</script>

<style lang="less" scoped>
@media print {
  .container {
    page-break-after: always;
  }
}
.container {
  padding: 50px 24px 0 24px;
}
.card_content {
  margin-top: 15px;
  img {
    width: 207px;
    height: 448px;
  }
}
.card_nd_title {
  margin-bottom: 30px;
  span {
    font-size: 16px;
    // padding-left: 10px;
    font-weight: bold;
    color: #000;
  }
}
.line {
  height: 6px;
  border-radius: 6px;
  // margin-left: 10px;
  background-color: #00b5d4;
  opacity: 0.3;
}
</style>

